<ul>
<?php
foreach ($this->container as $page)
{
    $hasChildren = $page->hasPages();
    if( ! $hasChildren)
    {
        ?>
        <li><a href="<?php echo $page->getHref(); ?>"><?php echo $page->getLabel(); ?></a></li>
        <?php
    }
    else
    {
        ?>
        <li>
            <a href="<?php echo $page->getHref(); ?>"><?php echo $page->getLabel(); ?></a>
            <ul>
            <?php
            foreach($page->getPages() as $child)
            {
                ?>
                <li><a href="<?php echo $child->getHref(); ?>"><?php echo $child->getLabel(); ?></a></li>
                <?php
            }
            ?>
            </ul>
        </li>
        <?php
    }
}
?>
</ul>